<?
require_once (__DIR__."/../classes/DB/DicionarioDB.php");

if(isset($_GET["param"])){
	$dicionarioDB = new DicionarioDB();
	$sugestoes = $dicionarioDB->procurarPalavra($_GET["param"],10);
	$count = mysql_num_rows($sugestoes);
}else{
	$sugestoes = array();
	$count = 0;
}

?>
<span class="indicator" style="display:none">Carregando...</span>
<select id="sugestao" name="sugestao" size="10" >
	<?
	if($count > 0 ){
		while ($row = mysql_fetch_assoc($sugestoes)){
		    echo("<option>".utf8_encode($row["palavra"])."</option>");
		}
	}else{
	    //todo
	}
	?>
</select>

